package com.examples.autoboxing;

import java.util.ArrayList;
import java.util.List;

public class AutoBoxing {

	/**
	 * auto boxing converting primitive type to class type after jdk1.5 automatically
	 */
	public static void main(String[] args) {
		System.out.println("auto boxing and unboxing Examples\n");
		List list = new ArrayList();
		int a=5;
		System.out.println("autoboxing int 5 to object implicitly"+a);
		list.add(5);//auto bxing
		list.add(new Integer(9));
		System.out.println("\nList contents"+ list);
		
		int index =   list.indexOf(9);
		int i = (Integer) list.get(index);
		System.out.println("\nun boxing value  " + i);
		
	}

}
